<?php

class Town extends Eloquent{
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */

	protected $table = 'towns';
	public $timestamps = false;
	
	public function district(){
		$district = $this->belongsTo('District', 'district_id');
		return $district != null ? $district : null;
	}

	public function streets(){
		$streets = $this->hasMany('Street','town_id');
		return $streets != null ? $streets : null;
	}
}